package cn.antsing.springbootConfig;

import cn.antsing.bean.EncodingConvert;
import cn.antsing.bean.GBKEncodingConvert;
import cn.antsing.bean.UTF8EncodingConvert;
import cn.antsing.condition.GBKCondition;
import cn.antsing.condition.UTF8Condition;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;

@SpringBootConfiguration
public class BeanConfig {
    @Bean
    @Conditional(GBKCondition.class)
    public EncodingConvert createGBKEncodingConvert(){
        return  new GBKEncodingConvert();
    }

    @Bean
    @Conditional(UTF8Condition.class)
    public EncodingConvert createUTF8EncodingConvert(){
        return new UTF8EncodingConvert();
    }
}
